import Vue from "vue";
import VueRouter from "vue-router";

// import Home from "../views/Home";
// 路由懒加载：1. 代码分割：将路由组件单独打包成一个js文件  2. 按需加载：需要使用时才会加载这个路由js文件
const Home = () => import("../views/Home");

Vue.use(VueRouter);

const routes = [
  {
    path: "/home",
    name: "Home",
    component: Home,
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
